<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h2>Home首页</h2>

    <span>{{ msg }}</span>

    <hr><br>
    <div>
      <h2>计数器：{{counter}}</h2>
      <button @click="counter++">+</button>
      <button @click="counter--">-</button>
    </div>
    <sub-item :counter="counter"></sub-item>
  </div>
</template>

<script>
import SubItem from "@/components/SubItem";

export default {
  name: 'Home',
  components :{
    SubItem
  },
  data () {
    return {
      msg: '这是测试首页',
      counter : 0
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
